const App = {
    mixins: [Query],//配置文件，路径/utils/mixins.js
    data() {
        return {
            photo,
            page: {
                value1:'',
                PageNumber: 1, //页码
                RowAmount: 10,
                Condition: window.btoa(unescape(encodeURIComponent("%%"))),
                ExtensionCondition:''
            },
        }
    },
    mounted() {

    },
    methods: {
        check(){
            this.page.Condition = window.btoa(unescape(encodeURIComponent("%"+this.page.value1+"%")));
            this.postgetList(this.page)
        },
        Treedata() {
            $.ajax({
                headers: requestHeaders(),
                url: `${mh}/generalBusiness/generalQueryByTableName`,
                type: "post",
                data: {
                    Data: 'blue_plate_information',
                    Condition: "Row_Status='0'",
                },
                success: (data) => {
                    console.log(data);
                    this.treeData = data; // 直接使用 this
                },
                complete: (XMLHttpRequest) => {
                    requestPretreatment(XMLHttpRequest);
                },
                dataType: "json",
            });
        },
        //树的点击筛选事件
        handleNodeClick(data, node) {
            this.page.Condition = window.btoa(unescape(encodeURIComponent("%"+data.Blue_Plate_SerialNumber+"%")));
            // let arr = [],str = '';
            // if (data.children) {
            //     this.Organization(data.children,arr);
            // }
            // [data.Grid_SerialNumber,...arr].forEach(item=>{
            //     if (str) {
            //         str += "\r\nOR blue_plate_information.Grid_SerialNumber='"+item+"'";
            //       } else {
            //         str = "\r\nblue_plate_information.Grid_SerialNumber='"+item+"'";
            //       }
            // })
            // if (str) {
            //     str = "AND ("+str+")"
            //   }
            // this.page.ExtensionCondition = window.btoa(unescape(encodeURIComponent(str)));
            this.postgetList(this.page)
        },
        Organization(data, arr) {
            data.forEach(item => {
                arr.push(item.Grid_SerialNumber);
                if (item.children && item.children.length > 0) {
                    this.Organization(item.children, arr);
                }
            })
        },
    },
};

const { createApp } = Vue;
const app = createApp(App);
//这种方式是引入全部图标，无需单个引入
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component);
}
const ElMessage = ElementPlus.ElMessage;
app.use(ElementPlus,{locale: zhCn});
app.mount("#app");
